#ifndef SYNCHRONIZED_QUEUE_H
#define SYNCHRONIZED_QUEUE_H

#include <queue>
#include <exception>
#include <string>
#include "Mutex.h"

namespace concurrent {

template <class T>
class SynchronizedQueue
{
public:
	SynchronizedQueue();

	void push(const T &val);
	T& pop();
	unsigned int size() const;
	bool empty() const;

private:
	Mutex _mutex;
	std::queue<T> _queue;	
};

class SynchronizedQueueException : public std::exception
{
public:
	SynchronizedQueueException(std::string message); 
	virtual const char *what() const throw();

private:
	std::string _message;
};

}

#endif /* SYNCHRONIZED_QUEUE_H */

